#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions  # The wmake functions
# -----------------------------------------------------------------------------

# Remove library files
# - regular and mpi-specific locations

for libDir in "$FOAM_LIBBIN" "$FOAM_SITE_LIBBIN" "$FOAM_USER_LIBBIN"
do
    if [ -d "$libDir" ]
    then
        for dir in "$libDir" "$libDir/$FOAM_MPI"
        do
            rm -f "$dir"/libpetscFoam*
        done
    fi
done

# Cleanup generated files - remove entire top-level
removeObjectDir "$PWD"

# -----------------------------------------------------------------------------
